<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">系统消息</view>
		</view>	
		<view class="bg_box">
			<image class="bg01" :src="getImgSrc('/static/bg05.png')" mode="widthFix"></image>
			<view class="bg_content">

				<block v-for="(item, index) in info" :key="'info' + index">
					<view class="tidings_box" @click="$r('/pages/public/art_detail?id='+item.id)">
						<view class="time">{{ item.add_time }}</view>
						<view class="content">
							<view class="title_box">
								<view class="round"></view>
								<view class="title">{{item.title}}</view>
							</view>
								<!-- <block v-for="(item02, index02) in item.text">
									<view class="text">{{item02.t}}</view>
								</block> -->
						</view>
					</view>
				</block>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page:1,
				scrrol:false,
				info: [
					
				],
				
			}
		},
		onLoad() {
			this.loadData();
		},
		methods: {
			setRule(e){
				let that = this;
				let index = e.currentTarget.dataset.index;
				that.flowList[index].tick = !that.flowList[index].tick
			},
			loadData() {
				let that = this;
				that.Net._get('other/notice', {page:that.page}, res => {
					if (res.code == 1) {
						that.info = res.data;
					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},

		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
		onReachBottom() {
			var that = this;
			that.page++;
			that.Net._get('other/notice', {per_page:'10',page:that.page,}, res => {
				if (res.code == 1) {
					if (res.data == '') {
						uni.showToast({
							title: '已经是最后一页了',
							duration: 2000,
							icon: 'none'
						});
					} else {
						that.info = that.info.concat(res.data); //将数据拼接在一起
					}
				} else if (res.code == 0) {
					that.Msg.Success(res.msg, res => {});
				}
			});
		},
	}
</script>

<style>
	
	.header{
		background-color: transparent !important;
	}
	
	.header .text{
		background-color: transparent !important;
		color: #333 !important;
	}
	
	.header .back{
		color: #333 !important;
	}
	
	.scrrolHeader{
		background-color: #F9E9E3 !important;
	}
	
	.bg_box{
		width: 100%;
		position: relative;
	}
	
	.bg_box .bg01{
		width: 100%;
	}
	
	.bg_box .bg_content{
		width: 92%;
		position: absolute;
		left: calc(50% - 46%);
		top: calc(13.5vw + var(--status-bar-height));
		z-index: 98;
	}
	
	.tidings_box {
		width: 92%;
		margin: 0 auto;
		margin-bottom: 5vw;
	}
	
	.tidings_box .time {
		font-size: 3vw;
		color: #999;
		text-align: center;
		height: 10.5vw;
		line-height: 6vw;
	}
	
	.tidings_box .content {
		background-color: #fff;
		border-radius: 1.5vw;
		padding:1.5vw 3vw 3vw 3vw;
		box-shadow: 0px 1px 4.65px 0.35px rgba(51, 51, 51, 0.09);
	}
	
	.tidings_box .content .title_box {
		display: flex;
	}
	
	.tidings_box .content .title_box .round {
		width: 2vw;
		height: 2vw;
		border-radius: 50%;
		background-color: #FF7F22;
		margin-top: 2.5vw;
	}
	
	.tidings_box .content .title_box .title {
		line-height: 6.5vw;
		font-size: 4vw;
		color: #333;
		margin-left: 1.5vw;
		font-weight: bold;
	}
	
	.tidings_box .content .text {
		font-size: 3vw;
		color: #333;
		line-height: 5vw;
	}
	
	.tidings_box .content .goods{
		width: 100%;
		display: flex;
	}
	
	.tidings_box .content .goods .goods_img{
		width: 24vw;
		height: 24vw;
		border-radius: 2vw;
		margin-right: 3vw;
	}
	
	.tidings_box .content .goods .goods_img image{
		width: 100%;
		height: 100%;
		border-radius: 2vw;
	}
	
	.tidings_box .content .goods .title{
		flex: 1;
		margin-right: 3vw;
		font-size: 3.5vw;
		color: #333;
		line-height: 5vw;
		display: flex;
		align-items: center;
	}
	
	
	
	
</style>
